<template>
    <div>
      <h1>登录</h1>
      <input type="text" v-model="username" placeholder="账号">
      <input type="password" v-model="password" placeholder="密码">
      <button @click="login">登录</button>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        username: '',
        password: ''
      };
    },
    methods: {
      login() {
        if (this.username === 'admin' && this.password === '123456') {
          this.$router.push({ name: 'StudentSystem' });
        } else {
          alert('账号或密码错误');
        }
      }
    }
  };
  </script>